package com.qqtech.qquan.user.model;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.enums.YesNoEnum;
import com.qqtech.core.common.util.StringUtil;
import com.qqtech.qquan.pub.model.PubCommentVo;
import com.qqtech.qquan.user.enums.UserConst;

@SuppressWarnings("serial")
public class UserTopicVo extends UserTopic {
	private String circleIds;

	/** 类型:1-互助;2-八卦;3-活动;4-社区;5-娱乐;6-财经;7-数码 */
	private Integer type;

	/** 社区id */
	private java.lang.Integer communityId;
	/** 版主名称 **/
	private java.lang.String creatorName;
	/** 版主头象 **/
	private java.lang.String creatorImg;
	/** 是否被当前登录人点过赞;1-是,2-否 **/
	private java.lang.Integer isPraised = YesNoEnum.NO.getCode();

	/** 是否被当前登录人关注;1-是,2-否 **/
	private java.lang.Integer isConcern = YesNoEnum.NO.getCode();

	/** 点赞人列表 **/
	private java.lang.String praiseUserList;

	/** 话题下的评论 **/
	private List<PubCommentVo> commentList;

	/** 索引 **/
	private Integer index;
	/**是否我自己创建的**/
	private boolean isBelongToMe = false;
	public String getCircleIds() {
		return circleIds;
	}

	public java.lang.Integer getCommentCont() {
		return this.getCommentCount();
	}
	
	public List<PubCommentVo> getCommentList() {
		return commentList;
	}

	public java.lang.Integer getCommunityId() {
		return communityId;
	}

	public java.lang.String getCreatorImg() {
		return creatorImg;
	}

	public java.lang.String getCreatorName() {
		return creatorName;
	}

	/**
	 * 版主头像全URL
	 * example: http://192.168.1.xxx:8080/circle/1.png
	 * @return
	 */
	public java.lang.String getFullCreatorImg() {
		if(StringUtil.isBlank(this.getCreatorImg())){
			return "";
		}else if(this.getCreatorImg().indexOf("source://")>-1){
			return this.getCreatorImg();
		} else{
			return super.getImgHandleDomain()+""+this.getCreatorImg()+""+UserConst.IMG_POSTFIX;
		}
	}

	/** 评论数量不为0 **/
	public java.lang.Boolean getHasComment() {
		if(this.getCommentCount() == 0){
			return false;
		}else{
			return true;
		}
	}

	/** 点赞数量不为0 **/
	public java.lang.Boolean getHasPraise() {
		if(this.getPraiseCount() == 0){
			return false;
		}else{
			return true;
		}
	}

	/** 点赞或评论数量不为0 **/
	public java.lang.Boolean getHasPraiseComment() {
		if(this.getCommentCount() == 0 && this.getPraiseCount() == 0){
			return false;
		}else{
			return true;
		}
	}

	public Integer getIndex() {
		return index;
	}

	public java.lang.Integer getIsConcern() {
		return isConcern;
	}

	public java.lang.Integer getIsPraised() {
		return isPraised;
	}

	/** 是否显示评论信息 **/
	public boolean getIsShowComment() {
		if (this.getCommentList() != null && this.getCommentList().size() > 0) {
			return true;
		} else {
			return false;
		}
	}

	/** 是否显示图片 **/
	public boolean getIsShowImg() {
		if (StringUtils.isNotBlank(this.getImg())) {
			return true;
		} else {
			return false;
		}
	}

	public String getPathImgs() {
		if (StringUtil.isBlank(this.getImg())) {
			return "";
		}
		String filePath = ";" + this.getFileDomain();
		String pathImgs = this.getImg().replaceAll(";", filePath);
		return this.getFileDomain() + pathImgs;
	}

	public java.lang.Integer getPraiseCont() {
		return this.getPraiseCount();
	}

	public java.lang.String getPraiseUserList() {
		return praiseUserList;
	}
	public Integer getType() {
		return type;
	}

	public boolean isBelongToMe() {
		return isBelongToMe;
	}

	public void setBelongToMe(boolean isBelongToMe) {
		this.isBelongToMe = isBelongToMe;
	}

	public void setCircleIds(String circleIds) {
		this.circleIds = circleIds;
	}
	
	public void setCommentList(List<PubCommentVo> commentList) {
		this.commentList = commentList;
	}

	public void setCommunityId(java.lang.Integer communityId) {
		this.communityId = communityId;
	}

	public void setCreatorImg(java.lang.String creatorImg) {
		this.creatorImg = creatorImg;
	}
	public void setCreatorName(java.lang.String creatorName) {
		this.creatorName = creatorName;
	}
	public void setIndex(Integer index) {
		this.index = index;
	}

	public void setIsConcern(java.lang.Integer isConcern) {
		this.isConcern = isConcern;
	}

	public void setIsPraised(java.lang.Integer isPraised) {
		this.isPraised = isPraised;
	}
	public void setPraiseUserList(java.lang.String praiseUserList) {
		this.praiseUserList = praiseUserList;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	
	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}
}